]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
search: remove redundant check
authorCosimo Cecchi <cosimo@endlesm.com>
Wed, 7 Jan 2015 10:16:04 +0000 (18:16 +0800)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 7 Jan 2015 23:26:21 +0000 (15:26 -0800)
We check for (metasNeeded.length == 0) at the beginning of the function,
which is only ever called when when a non-zero number of results is
received back from the provider. Effectively, this means that
(metas.length != metasNeeded.length) will also catch (metas.length == 0)
and print a nicer message to the log.

js/ui/search.js

index 4737c82328a0b18862e9dd4655a94f36f47fe5d6..7e7cb83faf7cae2cbc43fdba417211ff337a4a8f 100644 (file)
@@ -199,10 +199,6 @@ const SearchResultsBase = new Lang.Class({
             this._cancellable.reset();
 
             this.provider.getResultMetas(metasNeeded, Lang.bind(this, function(metas) {
-                if (metas.length == 0) {
-                    callback(false);
-                    return;
-                }
                 if (metas.length != metasNeeded.length) {
                     log('Wrong number of result metas returned by search provider ' + this.provider.id +
                         ': expected ' + metasNeeded.length + ' but got ' + metas.length);